package com.ms.client.monitor.api.service;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.ms.client.monitor.api.pojo.CliInfo;
import com.ms.msclient.MsClient;
import com.ms.msclient.MsClientResponse;

@MsClient(value="${service.id.monitor}", defalut="ms-cloud-monitor")
public interface ApiClientService {

	/**
	 * 根据客户端编号，获取要发布的项目
	 * @param clientId
	 * @return
	 */
	//public ResponseFrame findRelease(String clientId);

	/**
	 * 修改客户端发布项目成功
	 * @param clientId
	 * @param prjId
	 * @param version 
	 * @param status
	 * @param statusMsg 
	 * @return
	 */
	@RequestMapping(value = "/api/client/updateRelease")
	public MsClientResponse<CliInfo> updateRelease(@RequestParam("clientId")String clientId, @RequestParam("prjId")Integer prjId, @RequestParam("version")String version, @RequestParam("status")Integer status, @RequestParam("statusMsg")String statusMsg);

	/**
	 * 修改客户端的活动状态
	 * @param clientId
	 * @return
	 */
	@RequestMapping(value = "/api/client/heartbeat")
	public MsClientResponse<CliInfo> heartbeat(@RequestParam("clientId")String clientId);
	
	/**
	 * 下载文件
	 * @param url
	 * @return
	 */
	@RequestMapping(value = "/api/client/download")
	public ResponseEntity<byte[]> download(@RequestParam("url")String url);

}
